﻿namespace Middleware.ApiTest.Attributes
{
     [AttributeUsage(AttributeTargets.Property)]
    public class MaskAttribute : Attribute
    {
        public string MaskValue(string original)
        {
            if (string.IsNullOrEmpty(original) || original.Length <= 4)
                return "****";

            return original.Substring(0, 2) + "****" + original.Substring(original.Length - 2);
        }
    }
}